import React, { ReactElement, useEffect } from 'react'
import './index.d'
import WangEditor from 'wangeditor'
interface Props {

}

// class Paper extends React.Component {
//   render() {
//     return <div>

//     </div>
//   }
//   componentDidMount() {
//     var editor = new WangEditor('#editor')
//     editor.create()
//   }
// }

function Paper({ }: Props): ReactElement {
  useEffect(() => {
    // var E = window.wangEditor
    var editor = new WangEditor('#editor')
    // 或者 var editor = new E( document.getElementById('editor') )
    editor.create()
  }, [])
  return (
    <div>
      paper
      <div id="editor"></div>
    </div>
  )
}

export default Paper
